package cn.qingfeng.a003_chat_v2_1.message;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class Message {
    private String messageType;

    //    public abstract int getMessageType();
//
//    public static final int LoginRequestMessage = 0;
//    //    public static final int LoginResponseMessage = 1;
//    public static final int ChatRequestMessage = 2;
////    public static final int ChatResponseMessage = 3;
////    public static final int GroupCreateRequestMessage = 4;
////    public static final int GroupCreateResponseMessage = 5;
////    public static final int GroupJoinRequestMessage = 6;
////    public static final int GroupJoinResponseMessage = 7;
////    public static final int GroupQuitRequestMessage = 8;
////    public static final int GroupQuitResponseMessage = 9;
////    public static final int GroupChatRequestMessage = 10;
////    public static final int GroupChatResponseMessage = 11;
////    public static final int GroupMembersRequestMessage = 12;
////    public static final int GroupMembersResponseMessage = 13;
////    public static final int PingMessage = 14;
////    public static final int PongMessage = 15;
//
    public static final Map<String, Class<? extends Message>> messageClasses = new HashMap<>();

    static {
        messageClasses.put("login", LoginRequestMessage.class);
        messageClasses.put("login2", LoginResponseMessage.class);
        messageClasses.put("send", ChatRequestMessage.class);
        messageClasses.put("send2", ChatResponseMessage.class);
//        messageClasses.put(ChatResponseMessage, SendResponseMessage.class);
//        messageClasses.put(GroupCreateRequestMessage, GcreateRequestMessage.class);
//        messageClasses.put(GroupCreateResponseMessage, GcreateResponseMessage.class);
//        messageClasses.put(GroupJoinRequestMessage, GjoinRequestMessage.class);
//        messageClasses.put(GroupJoinResponseMessage, GjoinResponseMessage.class);
//        messageClasses.put(GroupQuitRequestMessage, GquitRequestMessage.class);
//        messageClasses.put(GroupQuitResponseMessage, GquitResponseMessage.class);
//        messageClasses.put(GroupChatRequestMessage, GsendRequestMessage.class);
//        messageClasses.put(GroupChatResponseMessage, GsendResponseMessage.class);
//        messageClasses.put(GroupMembersRequestMessage, GmembersRequestMessage.class);
//        messageClasses.put(GroupMembersResponseMessage, GmembersResponseMessage.class);
//        messageClasses.put(PingMessage, PingMessage.class);
//        messageClasses.put(PongMessage, PongMessage.class);
    }
}
